﻿using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace System.Config
{
  public class AuthenticationSettings
  {
    public String AuthenticationScheme { get; set; }
    public String LoginPath { get; set; }
    public String AccessDeniedPath { get; set; }
  }

  public interface IAuthenticationSettings
  {
    String AuthenticationScheme { get; }
    PathString LoginPath { get; }
    PathString AccessDeniedPath { get; }
  }

  public class AuthenticationSettingsFactory : IAuthenticationSettings
  {
    public String AuthenticationScheme { get; private set; }
    public PathString LoginPath { get; private set; }
    public PathString AccessDeniedPath { get; private set; }

    public AuthenticationSettingsFactory(IOptions<AuthenticationSettings> options)
    {
      AuthenticationScheme = options.Value.AuthenticationScheme;
      LoginPath = new PathString(options.Value.LoginPath);
      AccessDeniedPath = new PathString(options.Value.AccessDeniedPath);
    }
  }
}
